from flask import Flask

app = Flask(__name__)


import hashlib
import json,time,random

from flask import Flask,request
import anti_content as ac
app = Flask(__name__)
method= ['POST']

@app.route('/pddproject/anticontent/',methods=['POST','GET'])
def hello_world():  # put application's code here
    # request_args = request.json  # 传json
    # if not code_sign(request_args):  # 效验
    #     return json.dumps({'result': 0, 'error_msg': '非法请求,拒绝访问'})
    print('发生请求了~~')
    ip = request.headers['X-Real-Ip']
    with open('ip.txt','a+') as ff:
        ff.write(ip)
    AC = ac.Create_list()
    anti_content = AC.anti_content
    sign_font = AC.sign_font
    A = AC.A
    data = json.dumps({'success': True,'anti_content':anti_content,'errorMsg': None,'errorCode': 1000000,'sign_font':sign_font,'font': A})
    return data


if __name__ == '__main__':
    app.run(host="175.178.229.18",port=8787)
